<template>
	<view :class="[primarySize()]">
		<template v-for="(item,index) in business">
			<navigator hover-class="none" :url="'/pages/user/company_info?id='+item.id"
				class="business_item ">
				<view class="recom_info">
					<view class="m-list-flex">
						<view class="business_img">
							<image mode="aspectFit"
								:src="cdnurl(item.enterpriseinfo.logo)||'/images/business_logo.png'"></image>
						</view>
						<view class="m-cell-bd business_info">
							<view class="fs32 col0 fd">
								{{item.enterpriseinfo.full_name||item.enterpriseinfo.company_name}}</view>
							<view class="pt10">在招职位：{{item.statistics.job_count}}</view>
							<view class="pt10">{{item.city_name}} ｜ {{item.company_scale_name||''}} ｜
								{{item.industry_category_name||''}}</view>
							<view class="clearfix label_box" v-if="item.benefits.length>0">
								<view class="star_type" v-for="(benefit,index1) in item.benefits"  :key="id">
									{{benefit.name}}</view>
							</view>
						</view>
					</view>

				</view>
				<image src="/static/public/tip7.png" class="top" v-if="item.top>0" mode="aspectFit"></image>
			</navigator>
		</template>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		name: "business",
		props: {
			business: { // 属性名
				type: Array,
				value: []
			},
			toggleFav: {
				type: Boolean,
				value: false,
			}
		},
		data() {
			return {

			};
		},
		methods: {
			unfav(index) {
				let that =this;
				let company = this.business[index];
				this.$core.post({
					url: '/xilujob.company/toggle_fav',
					data: {
						company_id: company.id
					},
					success: ret => {
						if (!ret.data.is_fav) {
							uni.$on(app.globalData.Events.CompanyFavRemove, {
								company: company
							});
						}
					}
				});
			},
		}
	}
</script>

<style scoped>
	.business_item {
		box-shadow: 0px 1px 18px 0px rgba(0, 0, 0, 0.06);
		background-color: #fff;
		border-radius: 4rpx;
		border: 1px solid #EBEBEB;
		margin-bottom: 18rpx;
		padding: 35rpx 30rpx 30rpx;
		position: relative;
		overflow: hidden;
		position: relative
	}

	.business_img {
		align-self: flex-start;
		margin-top: 20rpx;
	}

	.business_img image {
		width: 116rpx;
		height: 116rpx;
		margin-right: 32rpx;
		margin-left: 20rpx;
	}

	/* .business_img image{width: 100%;height: 100%;display: block} */
	.business_info {
		font-size: 24rpx;
		color: #333
	}

	.cancel_star {
		text-align: center;
		font-size: 20rpx;
		color: #999;
		line-height: 39rpx;
		height: 39rpx;
		border-radius: 8rpx;
		border: 1rpx solid #E1E1E1;
		padding: 0 15rpx;
		margin-bottom: 13rpx;
		margin-right: 26rpx;
		margin-top: 40rpx;
	}

	.star_type {
		float: left;
		font-size: 20rpx;
		color: #999;
		border-radius: 8rpx;
		line-height: 39rpx;
		height: 39rpx;
		padding: 0 17rpx;
		background-color: #F7F7F7;
		border: 1rpx solid #F7F7F7;
		margin-right: 13rpx;
		margin-top: 13rpx;
	}

	.clearfix {
		display: block;
	}

	.clearfix:after {
		content: "$";
		display: block;
		height: 0;
		clear: both;
		visibility: hidden;
		overflow: hidden;
	}

	/* 组件 - flex */
	.m-list-flex {
		display: flex;
		align-items: center;
	}

	.m-list-flex .m-cell-bd {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		overflow: hidden;
	}

	.fs24 {
		font-size: 24rpx;
	}

	.col3 {
		color: #333
	}

	.fs32 {
		font-size: 32rpx;
	}

	.pt10 {
		padding-top: 10rpx;
	}

	.pt20 {
		padding-top: 20rpx;
	}

	.pb10 {
		padding-bottom: 10rpx;
	}

	.top {
		position: absolute;
		top: 0;
		right: 0;
		width: 74rpx;
		height: 74rpx;
	}

	.label_box {
		max-height: 72rpx;
		overflow: hidden;
		box-sizing: border-box;
	}
</style>